function payfor(obj) {
    let aliPay = document.querySelector(".Alipay-div");
    let wechatPay = document.querySelector(".Wechat-div");
    let imgAliPay = document.querySelector(".payStyleAlipay-div");
    let imgWechatPay = document.querySelector(".payStyleWechat-div");
    if (obj.className == 'layui-col-md2 Alipay-div') {
        $(wechatPay).css("border-top", "none").css("border-right", "none").css("border-bottom", "");
        $(aliPay).css("border-bottom", "none").css("border-left", "").css("border-top", "");
        $(imgAliPay).css("display", "");
        $(imgWechatPay).css("display", "none");
    } else {
        $(aliPay).css("border-left", "none").css("border-top", "none").css("border-bottom", "1px solid pink")
        $(wechatPay).css("border-bottom", "none").css("border-top", "1px solid pink").css("border-right", "1px solid pink");
        $(imgAliPay).css("display", "none");
        $(imgWechatPay).css("display", "");
    }
}
let time=new Date();
// 判断是否可支付
let payFlag = true;

function djs() {

    let now = new Date();//现在的时间
    let oldTime = now.getTime();//现在时间的毫秒数
    let newTime = time.getTime() + 60 * 1000
    let minutes = Math.floor((newTime - oldTime) / 1000 / 60)
    let seconds = Math.floor((newTime - oldTime) / 1000 - minutes * 60)

    let jugeTime = (newTime - oldTime);
    if (jugeTime <= 0) {
        payFlag = false;
        clearInterval(ms)
        document.getElementsByClassName("minute")[0].innerText = "00";
        document.getElementsByClassName("second")[0].innerText = "00";
        // timeOut();
    }else {
        let str = '0'
        if (minutes < 10)
            minutes = str + minutes

        if (seconds < 10)
            seconds = str + seconds
        document.getElementsByClassName("minute")[0].innerText = `  ${minutes}  `;
        document.getElementsByClassName("second")[0].innerText = `  ${seconds}  `;
    }
}
let ms = setInterval(djs, 1000);
function pay() {
    if (payFlag == false){
        layer.msg('订单已超时，将在五秒后自动返回')
        setTimeout(function () {
            window.location.href = `../html/vip.html`;
        },5000)
    }else {

    }
}